/*
 * AS_DVBC.H
 *
 * autoscan module internal API for DVB-C application.
  */
#ifndef __AS_DVBT_H__
#define __AS_DVBT_H__

#include <types.h>
#include <sys_config.h>
#include <api/libpub/as_module.h>

#if (defined(STAR_PROG_SEARCH_NIT_SDT_SUPPORT) || defined(COMBOUI))
void dvbt_tp_info2db(TP_INFO *info, T_NODE *tp)
{
	MEMSET(tp, 0, sizeof(T_NODE));
	tp->ft_type = FRONTEND_TYPE_T;

#ifndef COMBOUI
	tp->network_id = info->common.onid;
	tp->t_s_id = info->common.tsid;
	if(info->common.info_type == 1)
	{
		tp->frq = info->c_info.frequency * 10;
		tp->bandwidth = 8;		
		tp->FEC_inner= info->c_info.modulation;
	}
	else if(info->common.info_type == 2)
	{
		tp->frq = info->t_info.frequency;
		tp->bandwidth = info->t_info.bandwidth;
		tp->guard_interval = info->t_info.guard_interval;
		tp->FFT = info->t_info.FFT;
		tp->modulation = info->t_info.modulation;
	}
#else
	tp->network_id = info->combo_info.onid;
	tp->t_s_id = info->combo_info.tsid;
    tp->frq = info->combo_info.frequency;
    tp->bandwidth = info->combo_info.bandwidth;
    tp->guard_interval = info->combo_info.guard_interval;
    tp->FFT = info->combo_info.FFT;
    tp->modulation = info->combo_info.modulation;

/*    
	if (info->combo_info.info_type == 1)
	{
		tp->frq = info->combo_info.frequency * 10;
		tp->bandwidth = 8;
		tp->FEC_inner = info->combo_info.modulation;
	}
	else if(info->combo_info.info_type == 2)
	{
		tp->frq = info->combo_info.frequency;
		tp->bandwidth = info->combo_info.bandwidth;
		tp->guard_interval = info->combo_info.guard_interval;
		tp->FFT = info->combo_info.FFT;
		tp->modulation = info->combo_info.modulation;
	}
*/	
#endif
}
UINT16 nit_tp_search_nr = 0;
UINT16 nit_tp_search_id[256];

BOOL dvbt_tp_sanity_check(BOOL voltage_ctrl, T_NODE *tp, S_NODE *sat)
{
    if((tp->frq< AS_MIN_CAB_FREQUENCY*10)||(tp->frq>AS_MAX_CAB_FREQUENCY*10))
        return FALSE;
    else
        return TRUE;
}
#endif

#endif /* __AS_DVBC_H__ */

